#include <iostream>
#include <conio.h>
#include <boost\asio.hpp>
#include "client.h"
#include "log.h"


void logInit();

int main()
{
	logInit();
	try
	{
		int connectNum;
		std::string serverName;


		std::cout<<"Input how many connections u wanna make:\n";
		std::cin>>connectNum;
		std::cout<<"Input server address:\n";
		std::cin>>serverName;

		if(connectNum<=0||serverName.empty())
		{
			std::cout<<"Input error...\n";
			return 0;
		}

		jump::client::Client client(serverName, "8454",connectNum);

		client.run();
	}
	catch (std::exception& e)
	{
		LOG_ERR("Exception",e.what());
		//std::cout << "Exception: " << e.what() << "\n";
	}

	LOG_INFO("End of Client program");


	while(!kbhit()){}

	return 0;
}